/**
 * @title: UserUtils.java
 * @package com.sinoglobal.ningxia.utils
 * @description: myTask(用一句话描述该文件做什么)
 * @author wx
 * @date 2015-3-25 下午2:46:16
 */
package com.sinoglobal.ningxia.utils;

import com.sinoglobal.ningxia.beans.LoginVo;
import com.sinoglobal.ningxia.frame.FlyApplication;
import com.sinoglobal.sinostore.SinoStore;

/**
 * @author qiwx
 * @title: UserUtils.java
 * @package com.sinoglobal.ningxia.utils
 * @description: 配置用户信息
 * @date 2015-3-25 下午2:46:16
 */
public class UserUtils {

    public static void LoginSuccess(LoginVo result) {
        SharedPreferenceUtil.saveString(FlyApplication.context, "id", result.getId());
        SharedPreferenceUtil.saveString(FlyApplication.context, "photo", result.getImg());
        SharedPreferenceUtil.saveString(FlyApplication.context, "sex", result.getSex());
        SharedPreferenceUtil.saveString(FlyApplication.context, "username", result.getUsername());
        SharedPreferenceUtil.saveString(FlyApplication.context, "nickname", result.getNickname());
        SharedPreferenceUtil.saveString(FlyApplication.context, "score", result.getScore());
        SharedPreferenceUtil.saveString(FlyApplication.context, "signCount", result.getSignCount());
        SharedPreferenceUtil.saveString(FlyApplication.context, "userCenterId", result.getUserCenterId());
        SharedPreferenceUtil.saveString(FlyApplication.context, "jifen", result.getScore());

        FlyApplication.userId = result.getId();
        FlyApplication.jiFen = result.getScore();
        FlyApplication.userCenterId = result.getUserCenterId();
    }

    public static void ExitSccess() {
        SharedPreferenceUtil.saveString(FlyApplication.context, "id", MContants.EMPTY_STRING);
        SharedPreferenceUtil.saveString(FlyApplication.context, "photo", MContants.EMPTY_STRING);
        SharedPreferenceUtil.saveString(FlyApplication.context, "sex", MContants.EMPTY_STRING);
        SharedPreferenceUtil.saveString(FlyApplication.context, "nickname", MContants.EMPTY_STRING);
        SharedPreferenceUtil.saveString(FlyApplication.context, "score", MContants.EMPTY_STRING);
        SharedPreferenceUtil.saveString(FlyApplication.context, "photo", MContants.EMPTY_STRING);
        SharedPreferenceUtil.saveBoolean(FlyApplication.context, SharedPreferenceUtil.IS_PORTAL_FLAG, false);
        SharedPreferenceUtil.saveString(FlyApplication.context, "jifen", MContants.EMPTY_STRING);
        SharedPreferenceUtil.saveString(FlyApplication.context, "userCenterId", MContants.EMPTY_STRING);
        FlyApplication.userId = "";
        FlyApplication.jiFen = "";
        FlyApplication.userCenterId = "";
        SinoStore.initData("", "", "", "", "0");
        SharedPreferenceUtil.saveBoolean(FlyApplication.context, SharedPreferenceUtil.IS_PORTAL_FLAG, false);
        SharedPreferenceUtil.saveBoolean(FlyApplication.context, SharedPreferenceUtil.IS_LIVE_FLAG, false);
        SharedPreferenceUtil.saveString(FlyApplication.context, SharedPreferenceUtil.LIVE_LOCATION, "");


    }

}
